import { defineComponent } from 'vue'
import $style from './index.module.scss'

export default defineComponent({
    name : 'ColorBlockText',
    props : {
        type : {
            type : String,
            default : 'square'
        },

        color : {
            type : String,
            default : ''
        }
    },

    setup(props:{type : 'square' | 'dashed' | 'line', color: string, [key : string] : any}, context) {
        let className = [$style.container]
        className.push($style[props.type])
        return () => <div class={className}>
            <div class={$style.colorBlock} style={{borderColor : props.color}}></div>
            {context.slots.default &&
                context.slots.default().map(item => item)
            }
        </div>
    }
})